<template>
  <div class="inventory-process">
    <div class="header">
      <router-link to="/main/process" class="back-btn">
        <i class="el-icon-arrow-left"></i>
        <span>返回</span>
      </router-link>
      <h2>固定资产盘点作业流程</h2>
    </div>

    <div class="content">
      <!-- 流程步骤 -->
      <el-steps :active="activeStep" finish-status="success" align-center>
        <el-step title="发起申请" description="填写盘点申请"></el-step>
        <el-step title="计划制定" description="制定盘点计划"></el-step>
        <el-step title="盘点执行" description="执行盘点工作"></el-step>
        <el-step title="盘点核对" description="核对盘点结果"></el-step>
        <el-step title="生成报告" description="生成盘点报告"></el-step>
      </el-steps>

      <!-- 流程内容区域 -->
      <div class="process-content">
        <router-view @next-step="nextStep" @prev-step="prevStep"></router-view>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'AssetInventoryProcess',
  data() {
    return {
      activeStep: 0
    }
  },
  methods: {
    nextStep() {
      if (this.activeStep < 4) {
        this.activeStep++
        this.navigateToStep()
      }
    },
    prevStep() {
      if (this.activeStep > 0) {
        this.activeStep--
        this.navigateToStep()
      }
    },
    navigateToStep() {
      const routes = ['apply', 'plan', 'execute', 'check', 'report']
      this.$router.push(`/main/xingzheng/asset/inventory/${routes[this.activeStep]}`)
    }
  }
}
</script>

<style lang="scss" scoped>
.inventory-process {
  padding: 20px;

  .header {
    margin-bottom: 30px;
    position: relative;
    text-align: center;

    .back-btn {
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      text-decoration: none;
      color: #606266;
      display: flex;
      align-items: center;
    }

    h2 {
      margin: 0;
      font-size: 24px;
      color: #303133;
    }
  }

  .content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);

    .el-steps {
      margin-bottom: 30px;
    }

    .process-content {
      max-width: 1000px;
      margin: 0 auto;
      padding: 20px;
    }
  }
}
</style> 